<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Sale Report By The Given Year And Month</title>
<%@ page import="controllers.Accessdb" %>

</head>
<body>

<% 
 	Accessdb idc = new Accessdb();
	int year=0;
	int month=0;
 	 year = Integer.parseInt(request.getParameter("year"));
 	 month = Integer.parseInt(request.getParameter("month"));
 	ArrayList<String[]> resultList = idc.getSalesReportForMonth(year, month, 1);


%>

<%			if(resultList.size()==0)
				out.println("<p>There are no date machting the year and the month</p>");
			else{
%>
	<table border="1" cellspacing="0" cellpadding="0">
		<tr>
			<td>Advertisement_ID</td>
			<td>Employee</td>
			<td>Total Number_Of_Units</td>
			<td>Total Revenue</td>
		</tr>
		
		<% 
			}

	 			for(int i=0; i< resultList.size(); i++){
					out.println("<tr>");
					for(int j=0; j<resultList.get(i).length; j++){
						
	 					out.println("<td>" + resultList.get(i)[j] + "</td>");		
					
					
	 				}
					out.println("</tr>");
	 			}
					
		%>
<%--<td><%=resultList.get(i)[j] %> </td> --%>	
		
	
	
	</table>
	
	
	
		
</body>
</html>